<?php
/**
 * 公众号页面授权接口
 * @author lss
 * 2017-03-02
 */
namespace soa\mp;

use soa\client;

class WebAuth  extends client
{
    /**
     * 服务地址
     * @var string
     */
    public $service_url = 'http://mp.kuaidihelp.com/';

    /**
     * 服务名称
     * @var string
     */
    protected $service_name = 'kuaidihelp_mp';

	/**
	 * 获取页面授权链接
	 * @param $url
	 * @param string $state
	 * @param string $platform
	 * @param string $company
	 * @return array|bool|null
	 */
	public function url($url,$state = "weikuaidi",$platform = "weixin",$company = "kb"){
		if(!empty($url) && is_string($url)){
			return $this->post("api/WebAuth/url",[
				"url" => $url,
				"state" => $state,
				"platform" => $platform,
				"company" => $company,
			]);
		}
		return [];
	}
}